#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* button=new QPushButton("关闭窗口",this);
    button->resize(100,40);
    button->move(300,230);
    connect(button,&QPushButton::clicked,this,&Widget::handleClicked);
    //取消信号与槽函数的关联，参数一致
    disconnect(button,&QPushButton::clicked,this,&Widget::handleClicked);


}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClicked()
{
    this->close();
}
